//
//  NSString+Extension.h
//  QMUI_TEST
//
//  Created by mac on 17/4/28.
//  Copyright © 2017年 Apple. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, js_subTimeStyle) {
    kSubTimeStyle_Year,
    kSubTimeStyle_Month,
    kSubTimeStyle_Day,
};

typedef NSInteger(^js_subTime)(js_subTimeStyle);

@interface NSString (Extension)
/*!
 *  时间戳格式化
 *  Formatting  时间戳字符串
 *  Style       yyyy-MM-dd HH:MM:ss or yyyy.mm.dd HH:mm:ss
 *  return      格式化成功后的字符串 2017-04-28 11:13:00
 */
+(NSString *)timestampFormatting:(NSString *)timestamp FormattingStyle:(NSString *) style;
/*!
 *  时间转时间戳
 *  @currentTimer 需要格式化的时间
 *  @format       格式 yyyy-MM-dd HH:MM:ss or yyyy.mm.dd HH:mm:ss
 */
+(NSString *) changeEnterTimer:(NSString *)currentTimer format:(NSString *)format;
/*!
 *  中文编码处理
 */
- (NSString *)unicodeString;
/**
 * 时间转换 -> 5:23
 */
+(NSString *)timerForamting:(NSInteger )count;
/**
 * 获取距离现在多少年的时间戳
 */
+(NSString *)distanceCurrenDateYear:(NSInteger)year;
/**
 获取距离从指定时间到多少年后的时间戳
 
 @param time 开始时间戳
 @param year 距离年份
 
 @return 指定时间某年后的时间戳
 */
+(NSString *)formTimeStr:(NSString *)time distanceDateYear:(NSInteger)year;
/**
 根据字符串获取年月日
 
 @return 年月日
 */
-(js_subTime)gainTime;

-(NSMutableAttributedString *)settingAttachmentImage:(UIImage *)image frame:(CGRect) frame;
-(NSMutableAttributedString *)settingAttachmentImage:(UIImage *)image frame:(CGRect) frame attributedParmas:(NSDictionary *)parmase;
-(NSMutableAttributedString *)settingAttachmentImage:(UIImage *)image frame:(CGRect) frame fontColor:(UIColor *)fontColor range:(NSRange)range;
+(NSMutableAttributedString *)seetingFormString:(NSString *)formString subString:(NSString *)subString defauldColor:(UIColor *)defauldColor subColor:(UIColor *)subColor;
/**
 * 判断字符串是否为空
 */
+ (BOOL)isEmpty:(NSString *) str;

@end
